#include <Python.h>
#include <stdio.h>

// Note: more or less all this stuff has to be static.

static PyObject* c_printer(PyObject* self, PyObject* args)
{
    const char* to_print;

    if (!PyArg_ParseTuple(args, "s", &to_print))
        return NULL; // No appropriate data sent in.

    return(PyLong_FromLong(printf("%s\n", to_print)));
}


static PyMethodDef printFunctions[] = {{"c_print", c_printer, METH_VARARGS, "Prints something using printf, ahaha." }, {NULL, NULL, 0, NULL}};

static struct PyModuleDef c_printermodule = { PyModuleDef_HEAD_INIT, "c_print", NULL, -1, printFunctions };
PyMODINIT_FUNC PyInit_c_print(void)
{
    return(PyModule_Create(&c_printermodule));
}

